package com.bookstore.service;

import com.bookstore.entity.Book;
import com.bookstore.entity.PageBean;
import com.bookstore.entity.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author Cofe
 * @Date 2022/4/17 8:35
 */
@Service("bookService")
public interface BookService {
    //查询一本图书
    Book findBookById(int bid);
    //查询所有图书
    List<Book> findAllBook();
    //保存图书
    void saveBook(String book_name,String book_type, String book_intro, int book_number, double book_balance,double book_discount,double book_membalance,String imgname);
    //通过销量查询排列
    List<Book> findBookTop();
    //更新图书信息
    void updateBook(int bid,String book_name,String book_type, String book_intro, int book_number, double book_balance,double book_discount,double book_membalance);
    //更新图书销量信息
    void updateBookNew(int bid, int book_number,int book_sale);
    //分页查询
    PageBean<Book>  selectByPage(int currentPage,int pageSize);
    //分页查询条件
    PageBean<Book> selectByPageAndCondition(int currentPage, int pageSize, Book book);
    //删除图书
    String deleteBook(int bid);
    //分页查询
    PageBean<Book> findBookTopBalance(int currentPage, int pageSize);
}
